package com.hotelvip.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author Lzh
 * @date 2020/12/24 15:47
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class ImageVO implements Serializable {
    //{"error":0,"url":"图片的保存路径","width":图片的宽度,"height":图片的高度}
    private Integer error;
    private String url;     //图片虚拟访问路径
    private Integer width;  //宽度
    private Integer height; //高度
    private String path;//

    //success  fail
    public static ImageVO fail() {
        return new ImageVO(1, null, null, null, null);
    }

    public static ImageVO success(String url, Integer width, Integer height, String path) {
        return new ImageVO(0, url, width, height, path);
    }


}
